/*
 * @Author: shiguo
 * @Date: 2022-09-27 09:23:18
 * @LastEditors: shiguo
 * @LastEditTime: 2022-09-27 09:53:05
 * @FilePath: /@aks-dev/taro-h5/lib/WhiteSpace/index.tsx
 */
import { View } from "@tarojs/components";

import React from "react";
import type { WhiteSpaceProps } from '../../types/WhiteSpace';

export const WhiteSpace:
    React.FC<Partial<WhiteSpaceProps>>

    = props => {

        const { size = 'md' } = props
        return React.createElement(
            View,
            {
                style: {
                    ...(() => {
                        switch (size) {
                            case 'xs': return { height: '3px' };
                            case 'sm': return { height: '6px' };
                            case 'md': return { height: '9px' };
                            case 'lg': return { height: '15px' };
                            case 'xl': return { height: '21px' };
                        }
                    })(),
                    ...props.style
                }
            },
            props.children
        )
    }